class Solution
{
public:
    bool isThree(int n)
    {
        if (n == 1)
        {
            return false;
        }
        int root = sqrt(n);
        if (root != sqrt(n))
        {
            return false;
        }
        int upper = sqrt(root);
        for (int i = 2; i <= upper; ++i)
        {
            if (root % i == 0)
            {
                return false;
            }
        }
        return true;
    }
};